home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
os2
/
e33el2.zip
/
emacs
/
19.33
/
lisp
/
ediff-wind.el
< prev
next >
Wrap
Lisp/Scheme
|
1996-07-02
|
45KB
|
1,208 lines
;;; ediff-wind.el --- window manipulation utilities
;; Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer@cs.sunysb.edu>
;; This file is part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;; Code:
(require 'ediff-init)
;; Compiler pacifier
(defvar icon-title-format)
(defvar top-toolbar-height)
(defvar bottom-toolbar-height)
(defvar left-toolbar-height)
(defvar right-toolbar-height)
(defvar left-toolbar-width)
(defvar right-toolbar-width)
(defvar default-menubar)
(defvar frame-icon-title-format)
;; end pacifier
(defvar ediff-window-setup-function (if (ediff-window-display-p)
'ediff-setup-windows-multiframe
'ediff-setup-windows-plain)
"*Function called to set up windows.
Ediff provides a choice of two functions: ediff-setup-windows-plain, for
doing everything in one frame, and ediff-setup-windows-multiframe,
which sets the control panel in a separate frame. Also, if the latter
function detects that one of the buffers A/B is seen in some other frame,
it will try to keep that buffer in that frame.
If you don't like the two functions provided---write your own one.
The basic guidelines:
1. It should leave the control buffer current and the control window
selected.
2. It should set ediff-window-A, ediff-window-B, ediff-window-C,
and ediff-control-window to contain window objects that display
the corresponding buffers.
3. It should accept the following arguments:
buffer-A, buffer-B, buffer-C, control-buffer
Buffer C may not be used in jobs that compare only two buffers.
If you plan to do something fancy, take a close look at how the two
provided functions are written.")
;; indicates if we are in a multiframe setup
(ediff-defvar-local ediff-multiframe nil "")
;; Share of the frame occupied by the merge window (buffer C)
(ediff-defvar-local ediff-merge-window-share 0.45 "")
;; The control window.
(ediff-defvar-local ediff-control-window nil "")
;; Official window for buffer A
(ediff-defvar-local ediff-window-A nil "")
;; Official window for buffer B
(ediff-defvar-local ediff-window-B nil "")
;; Official window for buffer C
(ediff-defvar-local ediff-window-C nil "")
;; Ediff's window configuration.
;; Used to minimize the need to rearrange windows.
(ediff-defvar-local ediff-window-config-saved "" "")
(defvar ediff-split-window-function 'split-window-vertically
"*The function used to split the main window between buffer-A and buffer-B.
You can set it to a horizontal split instead of the default vertical split
by setting this variable to `split-window-horizontally'.
You can also have your own function to do fancy splits.
This variable has no effect when buffer-A/B are shown in different frames.
In this case, Ediff will use those frames to display these buffers.")
(defvar ediff-merge-split-window-function 'split-window-horizontally
"*The function used to split the main window between buffer-A and buffer-B.
You can set it to a vertical split instead of the default horizontal split
by setting this variable to `split-window-vertically'.
You can also have your own function to do fancy splits.
This variable has no effect when buffer-A/B/C are shown in different frames.
In this case, Ediff will use those frames to display these buffers.")
(defconst ediff-control-frame-parameters
(list
'(name . "Ediff")
;;'(unsplittable . t)
'(minibuffer . nil)
'(user-position . t) ; Emacs only
'(vertical-scroll-bars . nil) ; Emacs only
'(scrollbar-width . 0) ; XEmacs only
'(menu-bar-lines . 0) ; Emacs only
;; don't lower and auto-raise
'(auto-lower . nil)
'(auto-raise . t)
;; this blocks queries from window manager as to where to put
;; ediff's control frame. we put the frame outside the display,
;; so the initial frame won't jump all over the screen
(cons 'top (if (fboundp 'ediff-display-pixel-height)
(1+ (ediff-display-pixel-height))
3000))
(cons 'left (if (fboundp 'ediff-display-pixel-width)
(1+ (ediff-display-pixel-width))
3000))
)
"Frame parameters for displaying Ediff Control Panel.
Do not specify width and height here. These are computed automatically.")
;; position of the mouse; used to decide whether to warp the mouse into ctl
;; frame
(ediff-defvar-local ediff-mouse-pixel-position nil "")
;; not used for now
(defvar ediff-mouse-pixel-threshold 30
"If the user moves mouse more than this many pixels, Ediff won't warp mouse into control window.")
(defvar ediff-grab-mouse t
"*If t, Ediff will always grab the mouse and put it in the control frame.
If 'maybe, Ediff will do it sometimes, but not after operations that require
relatively long time. If nil, the mouse will be entirely user's
responsibility.")
(defvar ediff-control-frame-position-function 'ediff-make-frame-position
"Function to call to determine the desired location for the control panel.
Expects three parameters: the control buffer, the desired width and height
of the control frame. It returns an association list
of the form \(\(top . <position>\) \(left . <position>\)\)")
(defvar ediff-control-frame-upward-shift (if ediff-xemacs-p 42 14)
"*The upward shift of control frame from the top of buffer A's frame.
Measured in pixels.
This is used by the default control frame positioning function,
`ediff-make-frame-position'. This variable is provided for easy
customization of the default.")
(defvar ediff-narrow-control-frame-leftward-shift (if ediff-xemacs-p 7 3)
"*The leftward shift of control frame from the right edge of buf A's frame.
Measured in characters.
This is used by the default control frame positioning function,
`ediff-make-frame-position' to adjust the position of the control frame
when it shows the short menu. This variable is provided for easy
customization of the default.")
(defvar ediff-wide-control-frame-rightward-shift 7
"*The rightward shift of control frame from the left edge of buf A's frame.
Measured in characters.
This is used by the default control frame positioning function,
`ediff-make-frame-position' to adjust the position of the control frame
when it shows the full menu. This variable is provided for easy
customization of the default.")
;; Wide frame display
;; t means Ediff is using wide display
(ediff-defvar-local ediff-wide-display-p nil "")
;; keeps frame config for toggling wide display
(ediff-defvar-local ediff-wide-display-orig-parameters nil
"Frame parameters to be restored when the user wants to toggle the wide
display off.")
(ediff-defvar-local ediff-wide-display-frame nil
"Frame to be used for wide display.")
(ediff-defvar-local ediff-make-wide-display-function 'ediff-make-wide-display
"The value is a function that is called to create a wide display.
The function is called without arguments. It should resize the frame in
which buffers A, B, and C are to be displayed, and it should save the old
frame parameters in `ediff-wide-display-orig-parameters'.
The variable `ediff-wide-display-frame' should be set to contain
the frame used for the wide display.")
;; Frame used for the control panel in a windowing system.
(ediff-defvar-local ediff-control-frame nil "")
(defvar ediff-prefer-iconified-control-frame nil
"*If t, keep control panel iconified when help message is off.
T